import request from '@/axios'
import type { CurdData } from './types'

export const getListApi = (params?: any) => {
  return request.get({ url: 'admin/cryptoNews', params })
}
export const getSearchInfoApi = (id: string): Promise<IResponse<CurdData>> => {
  return request.get({ url: 'admin/cryptoNews/searchNews/' + id })
}
export const getAssociateSelectApi = (params?: any) => {
  return request.get({ url: '/admin/cryptoNews/machineList', params })
}
export const getGlobalPromptsApi = (params?: any) => {
  return request.get({ url: '', params })
}
export const saveGlobalPromptsConfigApi = (data): Promise<IResponse> => {
  return request.post({ url: '', data })
}

//行业新闻-详情-回显
export const getInfoApi = (id: string): Promise<IResponse<CurdData>> => {
  return request.get({ url: 'admin/cryptoNews/' + id })
}
//行业新闻-详情-获取枚举
export const getPlatformSelectApi = (params?: any) => {
  return request.get({ url: '/admin/cryptoNews/fieldEnum', params })
}
//行业新闻-详情-生成
export const publishConfigApi = (data): Promise<IResponse> => {
  return request.post({ url: '/admin/marketSMCopywritingTasks/batchGeneration', data })
}
//行业新闻-详情-任务详情回显
export const getSMCDetailApi = (id: string): Promise<IResponse<CurdData>> => {
  return request.get({ url: '/admin/marketSMCopywritingTasks/' + id })
}
//行业新闻-详情-任务详情-全量发布/发布
export const publishSMCApi = (data): Promise<IResponse> => {
  return request.put({ url: '/admin/marketSMCopywriting/publish', data })
}
//行业新闻-详情-重新生成
export const rebuildApi = (id: string): Promise<IResponse<CurdData>> => {
  return request.get({ url: '/admin/marketSMCopywriting/regenerate/' + id })
}
//行业新闻-详情-任务详情-修改内容
export const editContentApi = (data): Promise<IResponse> => {
  return request.put({ url: '/admin/marketSMCopywriting', data })
}
